<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();  
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<base href="<%=basePath%>">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>预警日志</title>
	<script type="text/javascript">
		function alert_log_jump() {
			var page = $("#alertlogpage").val();
			alert_log(page);
		}
	</script>
</head>

<body>
	<div style="width:100%;">
		<h2>预警日志</h2>
		<table class="table table-bordered table-hover">
			<thead>
				<tr>
					<th>设备编号</th>
					<th>预警等级</th>	
					<th>预警时间</th>
					<th>处理情况</th>
				</tr>
			</thead>
			<tbody>
				<c:if test="${list != null}">
				<c:forEach items="${list}" var="item"> 
				<tr> 
					<td>${item.deviceNum}</td>
					<td>${item.rankName}</td>
					<td>${item.time}</td>
					<td>${item.status}</td>
				</tr>
				</c:forEach>
				</c:if>
			</tbody>
			<tfoot>
            <tr>
                <td colspan="4">
                	共${totalRows}条记录,${currPage}/${totalPage}页
    			<a href="javascript:void(0);" onclick="alert_log(1)">第一页</a>
    			<a href="javascript:void(0);" onclick="alert_log(${currPage-1})">上一页</a>
    			<a href="javascript:void(0);" onclick="alert_log(${currPage+1})">下一页</a>
    			<a href="javascript:void(0);" onclick="alert_log(${totalPage})">最末页</a>
    			<input type="text" id="alertlogpage" name="alertlogpage" size="3"/>
	    		<button onclick="alert_log_jump()">跳转</button>
    			</td>
            </tr>
        </tfoot>
		</table>
	</div>
</body>
</html>